package net.anzhuo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import net.anzhuo.common.entity.PaginationVO;
import net.anzhuo.dao.GsEnquityPenetrationMapper;
import net.anzhuo.entity.GsEnquityPenetration;
import net.anzhuo.service.GsEnquityPenetrationService;
@Service
public class GsEnquityPenetrationServiceImpl implements GsEnquityPenetrationService {

	@Autowired
	private GsEnquityPenetrationMapper gsEnquityPenetrationMapper;
	
	@Override
	public GsEnquityPenetration getById(Long id) {
		// TODO Auto-generated method stub
		
		return gsEnquityPenetrationMapper.getById(id);
	}

	@Override
	public List<GsEnquityPenetration> getBycoMd5(String coMd5) {
		// TODO Auto-generated method stub
		return gsEnquityPenetrationMapper.getBycoMd5(coMd5);
	}

	@Override
	public PaginationVO<GsEnquityPenetration> getListWithPage(GsEnquityPenetration gsCheck) {
		PaginationVO<GsEnquityPenetration> paginationVO = new PaginationVO<>();
		paginationVO.setList(gsEnquityPenetrationMapper.getListWithPage(gsCheck));
		paginationVO.setTotalCount(gsEnquityPenetrationMapper.getCount(gsCheck));
		paginationVO.setTotalPage((gsEnquityPenetrationMapper.getCount(gsCheck) + gsCheck.getPageSize() -1)  / gsCheck.getPageSize());
		paginationVO.setPageNo(gsCheck.getPageNo());
		return paginationVO;
	}



	@Override
	public List<GsEnquityPenetration> getList(GsEnquityPenetration gsCheck) {
		// TODO Auto-generated method stub
		return gsEnquityPenetrationMapper.getList(gsCheck);
	}

	@Override
	@Transactional(rollbackFor=Throwable.class)
	public void update(GsEnquityPenetration gsCheck) {
		// TODO Auto-generated method stub
		gsEnquityPenetrationMapper.update(gsCheck);

	}

	@Override
	@Transactional(rollbackFor=Throwable.class)
	public void save(GsEnquityPenetration gsCheck) {
		// TODO Auto-generated method stub
		gsEnquityPenetrationMapper.save(gsCheck);
	}

	@Override
	@Transactional(rollbackFor=Throwable.class)
	public void delete(Long id) {
		
		gsEnquityPenetrationMapper.delete(id);

	}

}
